Repository navigation
fix(aggregator): top-level error boundary, per-facet fail-soft, consistent 404s (#1211) - #3985
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Closed
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements issue #1211 (queue task 4920), the three triage-confirmed gaps in
pm-stack/aggregator/src/server.ts:1. Top-level error boundary —
fetchHandlernow catches a throwinghandler: page routes get a styled 500 page,/apiroutes get JSON 500, and the render-health record still runs (accounting the failure as an unsuccessful render) instead of the fetch rejecting. Response construction lives in the newsrc/error-boundary.ts(state-free, unit-testable — thepath-segment.tsprecedent).2. Per-facet fail-soft — the unguarded aggregate contexts now catch per facet, mirroring the existing guarded
/programroute:boardContext(board/items),roadmapContext(roadmap/items),attentionContext(attention/orchestration/coverage),todayContext+overviewContext(quota/orchestration), the/quotapage and/quota/service(usage), and the/itemlookup (board/roadmap/items/comments). Fallbacks are the honest empty forms (emptyQuotaView()/emptyUsageView()/[]/null), so renderers banner absent data (e.g. the tier-source-missing flag) instead of the whole page 500ing.3. Consistent not-found —
/item/<miss>and/quota/service/<miss>now return their styled HTML at status 404 (were 200); the unknown-path fallthrough usesnotFoundResponse: styled HTML 404 for page routes, JSON 404 for/api. Existing explicit-404 routes unchanged.Tests — new
test/error-boundary-1211.test.ts: unit tests for the boundary/not-found responses + boot tests (fixtures) for the 404 semantics, known pages still 200, and the degraded attention render. Laptop results: new file 6/6 pass,boot.test.ts11/11 pass, full aggregator suite 920 pass / 1 fail — the one failure (slice3 > dns + sessions + pages routes serve, registry records) fails identically on clean main in this environment (pre-existing, unrelated).tsc --noEmit: exactly the same 12 pre-existing errors as clean main, none in the changed files.One acceptance nuance: "a stub source that throws per-facet" cannot be boot-injected today —
server.tspicks its Source at module level with no test seam, and I did not add a production seam for tests. The fail-soft half is therefore covered by construction (same.catchpattern as/program) + the degraded-render boot assertion; the boundary half is unit- and response-tested. Happy to add a stub-source seam as a follow-up if wanted.🤖 Queue worker (repo-worker-code), lane A — task 4920
Need help on this PR? Tag
@codesmith-botwith what you need.